<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  <title>Document</title>
  <link rel="stylesheet" href="css/normalize.css">
  <link rel="stylesheet" href="css/common.css">
  <link rel="stylesheet" href="css/teacherDetail.css">
  <link rel="stylesheet" href="css/iconfont.css">
</head>

<body>
  <div class="container">
    <header>
      <div class="header-return" id="toreturn">
        <i class="iconfont">&#xe600;</i>
      </div>
      <div class="header-title">
        师资力量
      </div>
    </header>
    <section>
      <div class="detail-img" id="detailImg">

      </div>
      <div class="detail-text" id="detailText">

      </div>
    </section>

  </div>
  <script src="./js/flexible.js"></script>
  <script src="./js/zepto.min.js"></script>
  <script src="./js/zepto.touch.js"></script>
  <script src="./js/lazyload.min.js"></script>
  <script>
    $(function () {
      // 接受传递过来的路径
      var getTitle = decodeURI(window.location.hash.replace(/#/, ''))
      // 返回上一页
      $('#toreturn').tap(function () {
        window.history.go(-1)
      })
      // 请求数据
      $.ajax({
        url: 'http://39.101.217.150:8075/teachers/list',
        data: {
          page: 1,
          size: 1,
          name: getTitle
        },
        success: function (data) {
          // console.log(data);
          var aRecords = data.data.records[0]
          $('#detailImg').append(`
            <img src="${aRecords.imgurl}" alt="">
          `)
          $('#detailText').append(`
            <div class="names">
              <span>${aRecords.name}</span>
              <span class="time">${aRecords.createTime}</span>
            </div>
            <div class="text">
              ${aRecords.content}
            </div>
          `)
        }
      })
    })
  </script>
</body>

</html>